home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / ptv1n4.arc / HWMAIN.PAS < prev    next >
Pascal/Delphi Source File  |  1990-09-13  |  975b  |  49 lines

  1. {$S-,I-,R-}
  2. unit HWmain;
  3.  
  4. interface
  5.  
  6. uses
  7.   OpSwap1;
  8.  
  9.   procedure HelloWorldMain;
  10.  
  11. implementation
  12.  
  13. const
  14.   HotKey = $080F;            {code for Alt-Tab}
  15.   Swap1 = 'HELLO1.SWP';
  16.   Swap2 = 'HELLO2.SWP';
  17.  
  18.   {$F+}
  19.   procedure PopupEntryPoint;
  20.     {-Routine called when our hotkey is pressed}
  21.   begin
  22.     WriteLn('Hello world!');
  23.   end;
  24.   {$F-}
  25.  
  26.   procedure HelloWorldMain;
  27.     {-Define a popup and go resident}
  28.   begin
  29.     {disable swapping message if swapping to EMS}
  30.     SetSwapMsgOn( not WillSwapUseEms(ParagraphsToKeep) );
  31.  
  32.     {define the popup}
  33.     if DefinePop(HotKey, PopupEntryPoint, Ptr(SSeg,SPtr)) then begin
  34.       WriteLn('TSR loaded, press <Alt><Tab> to activate.');
  35.  
  36.       {Make popup routines active.}
  37.       PopupsOn;
  38.  
  39.       {try to go resident}
  40.       StayResSwap(ParagraphsToKeep, 0, Swap1, Swap2, True);
  41.     end;
  42.  
  43.     {if we get here we failed to go resident}
  44.     WriteLn('Unable to go resident.');
  45.   end;
  46.  
  47. end.
  48.  
  49.